package net.zjitc.service;

import com.zjitc.domain.Mail;
import com.zjitc.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
 @Autowired
    MqProduct mqProduct;
    public void insert(User user){
        //1.插入数据库
        //2.发送邮件消息放入队列
        Mail mail = new Mail();
        mail.setTo(user.getEmail());
        mail.setSubject("邮箱激活");
        mail.setContent("hi,this is a message");
        mqProduct.sendMessage(mail);
    }
}
